# @Author   : 懒羊羊
# @File     : work_12_3.py
# @Time     : 2024/12/3 17:53
import time

from selenium.webdriver.chrome import webdriver
from selenium.webdriver.common.by import By

wd = webdriver.WebDriver()

wd.get("https://www.baidu.com/")

# wd.find_element(By.ID, "kw").send_keys("python")
#
# wd.find_element(By.ID, "su").click()


# wd.find_element(By.NAME, "wd").send_keys("python")
# wd.find_element(By.ID, "su").click()


# wd.find_element(By.CLASS_NAME, "s_ipt").send_keys("python")
# wd.find_element(By.CLASS_NAME, "s_btn").click()

# wd.find_element(By.XPATH, "/html/body/div[1]/div[1]/div[5]/div/div/form/span[1]/input").send_keys("python")
# wd.find_element(By.XPATH, "/html/body/div[1]/div[1]/div[5]/div/div/form/span[2]/input").click()


wd.find_element(By.XPATH, "//form[@id='form']//span//input").send_keys("python")
wd.find_element(By.XPATH, "//input[@id='su']").click()

time.sleep(5)

wd.quit()
